#ifndef _NUTS_DELAY_
#define _NUTS_DELAY_

#include "stm32f4xx.h"

namespace nuts
{
#ifdef __cplusplus
	extern "C" {
#endif

	inline void
	delay(__IO int32_t n, const uint32_t unit = 10000)
	{
		while (n--) {
			for (__IO int32_t i = 0;
			     i < unit; i++)
				;
		}
	}

	void systick_delay_ms(const uint32_t);

#ifdef __cplusplus
	}
#endif

}

#endif